const meet = require("../../database/meet");
const uuid = require("uuid");

module.exports = async (req, res, next)=>{
  const {name, count, config} = req.body;
  
  await meet.insertMany( {
    meetId: "meet-" + uuid.v1(),
    name, 
    count: count-0,
    config: Array.isArray(config) ? config : JSON.parse(config),
    type: count<10 ? "s" : (count>20 ? "l" : "m"),
    state: false,
    meetingId: ""
  } )

  res.send({
    code:1,
    msg:"会议室添加成功"
  })

}